<?php
namespace app\admin\controller;
use app\admin\model\AuthRule;
use app\admin\model\Tags;
use think\Controller;
use think\facade\Cache;
use think\model\Collection;
use app\common\controller\Base;

class Index extends Common
{
    public function index()
    {
        $user=\app\admin\model\User::with('userGroup')->get(UID);
        $rules=[];
        foreach ($user['userGroup'] as $group){
            $rules=array_merge($rules,explode(',',$group['rules']));
        }
        $menus= \app\admin\model\AuthRule::getMenu($rules);
        $this->assign('menus',$menus);
        return $this->fetch();
    }

    public function welcome()
    {
//        cache('myConfig',null);
//        exit;
//        $image = \think\Image::open('./image.png');
//        cache('myConfig',null);
        $res=getMyConfig();
        dump($res);exit;
    }
    public function index2()
    {
        $a=AuthRule::all();
        dump($a);exit;
    }

}
